<?php 
/**
 * 个人资料控制器
 * @author 杨帆
 */
class MyInfoController extends Controller{
    private  $model;
    
    public function __init(){
        $this->model = K('User');
    }
    
    /**
     * 默认显示
     */
    public function index(){
       $uid = $_SESSION['uid'];
       $MyInfodata = $this->model->where("uid={$uid}")->find();
       $this->assign('MyInfodata',$MyInfodata);
//     p($data);
       $this->display(); 
    }
    
    /**
     * 添加
     */
    public function addData(){
        if(IS_POST){
            if($this->model->addData()){
                $this->error($this->model->error);
            }  
            $this->success('资料提交成功','Index/Center/index'); 
        }
        
    }
 }
 
 
 
 
 
 
 
 
 
 
 



 ?>